#include <cstdio>
#include <cstring>
#include <cstdlib>

	struct inhibttype	{
		char	name[270];
		double pos;
		int dir;
	} inhibt[33000];
	int n;
	double V, L;
	int ncount, pcount;
	double tp, tn;
	int fp, fn;
	char	lastone[270];
	double t;
	
main()
{
	char	d;
	int 	i, j, k;
	long	tmp;
	
	//freopen("a.in", "r", stdin);
	//freopen("a.txt", "w", stdout);
	
	while(scanf("%d", &n), n>0)
	{
		scanf("%lf%lf", &L, &V);
		ncount = pcount = 0;
		for (i=1; i<=n; i++)
		{
			d = ' ';
			while (d != 'p' && d != 'P' && d != 'n' && d != 'N')
				scanf("%c", &d);
			if (d == 'p' || d=='P')
			{
				inhibt[i].dir = 1;
				pcount++;
			}
			if (d == 'n' || d=='N')
			{
				inhibt[i].dir = -1;
				ncount++;
			}
			scanf("%lf", &(inhibt[i].pos));
			scanf("%s", inhibt[i].name);
		}
		fp = -1;
		for (i=1; i<=n; i++)
			if (inhibt[i].dir > 0)
			{
				fp = i;
				break;
			}
		fn = -1;
		for (i=n; i>=1; i--)
			if (inhibt[i].dir < 0)
			{
				fn = i;
				break;
			}
		if (fp > 0 && fn > 0)
		{
			tp = (L-inhibt[fp].pos) / V;
			tn = inhibt[fn].pos / V;
			if (tp > tn)
			{
				t = tp;
				strcpy(lastone, inhibt[ncount+1].name);
			} else
			{
				t = tn;
				strcpy(lastone, inhibt[ncount].name);
			}
		} else
		if (fp > 0)
		{
			t = tp = (L-inhibt[fp].pos) / V;
			strcpy(lastone, inhibt[1].name);
		} else
		if (fn > 0)
		{
			t = tn = inhibt[fn].pos / V;
			strcpy(lastone, inhibt[n].name);
		}
		tmp = t * 100;
		printf("%13.2lf %s\n", (double) tmp / 100, lastone);
	}
	return 0;
}

